package com.xiaoy.dao;


import java.io.File;

import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.ImprovedNamingStrategy;
import org.hibernate.tool.hbm2ddl.SchemaExport;

//import org.hibernate.cfg.AnnotationConfiguration;
//import org.hibernate.cfg.Configuration;
//import org.hibernate.tool.hbm2ddl.SchemaExport;

/*
 * 用于生成表
 */

public class CreateBDTable {
	
	public void exprotTable () {
		
		
//		System.out.println(new File("sss").getAbsolutePath());
		
		ImprovedNamingStrategy strategy = new ImprovedNamingStrategy();
		//读取hibernate.cfg.xml文件
		Configuration cfg = new AnnotationConfiguration().setNamingStrategy(strategy).configure();
		
		SchemaExport export = new SchemaExport(cfg);
		
		export.create(true, true);
	}
	
	
	
	public static void main(String[] args) {
		
//		new ExportDB().exprotTable();
		new CreateBDTable().exprotTable();
		
		
	}
	
}	
